package D.队列;

import java.util.Deque;
import java.util.LinkedList;
import java.util.Queue;

public class _933_最近的请求次数 {
    private int requestTime ;
    Queue<Integer> queue;
    public _933_最近的请求次数() {

        requestTime =0;
        queue = new LinkedList<>();


    }

    public int ping(int t) {
        queue.add(t);
       // requestTime += t;
        while (queue.peek() < (t-3000) ){
            queue.poll();
        }
        return queue.size();

    }
}
